/*    */ package com.alipay.api.util;
/*    */ 
/*    */ import java.io.UnsupportedEncodingException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class HexUtils
/*    */ {
/* 14 */   private static final char[] hexLookUp = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   public static String bytesToHexStr(byte[] bytes) {
/* 23 */     StringBuffer stringBuffer = new StringBuffer(bytes.length * 2);
/* 24 */     for (int i = 0; i < bytes.length; i++) {
/* 25 */       stringBuffer.append(hexLookUp[bytes[i] >>> 4 & 0xF]);
/* 26 */       stringBuffer.append(hexLookUp[bytes[i] & 0xF]);
/*    */     } 
/* 28 */     return stringBuffer.toString();
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   public static byte[] hexStrToBytes(String str) {
/* 37 */     byte[] bytes = new byte[str.length() / 2];
/* 38 */     for (int i = 0; i < bytes.length; i++) {
/* 39 */       bytes[i] = (byte)Integer.parseInt(str.substring(2 * i, 2 * i + 2), 16);
/*    */     }
/*    */     
/* 42 */     return bytes;
/*    */   }
/*    */   
/*    */   public static void main(String[] args) throws UnsupportedEncodingException {}
/*    */ }


/* Location:              C:\Users\Administrator\Downloads\jd-gui-windows-1.6.6\jd-gui-windows-1.6.6\alipay-sdk-1.1.jar!\com\alipay\ap\\util\HexUtils.class
 * Java compiler version: 5 (49.0)
 * JD-Core Version:       1.1.3
 */